#pragma once

#include <ostream>
#include <istream>

class Vector {
public:
	explicit Vector (const size_t n);
	Vector (const size_t n, const double* dp);
	Vector (const Vector& another);
	Vector (const size_t n, const Vector& another);
	virtual ~Vector();
	size_t size() const;
	void exchange(size_t firstIndex, size_t secondIndex);
	
	double& operator[](const size_t index) const;
	double& operator[](const size_t index);
	Vector& operator= (const Vector& another);
	Vector& operator+= (const Vector& another);
	Vector& operator*= (const double constant);
	Vector& operator-= (Vector& another);
	
	Vector invering (Vector& another);
	Vector operator+(Vector& second) const;
	Vector operator- (Vector& second) const;
	Vector operator* (double constant) const;
	double operator*(const Vector& second) const;
	
private:
	bool isIndexValid ( const size_t index ) const;
private:
	size_t dimension;
	double *data;

};


Vector operator* (double constant, Vector& another);
std::ostream& operator << (std::ostream& outputStream, const Vector& vector);
std::istream& operator >> (std::istream& inputStream, Vector& vector);
